package com.springmvc.service.impl;

import com.springmvc.dao.ExpendTableMapper;
import com.springmvc.model.ExpendTable;
import com.springmvc.model.ExpendTableExample;
import com.springmvc.service.ExpendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ExpendServiceImpl implements ExpendService {
    @Autowired
    ExpendTableMapper expendTableMapper;
    @Override
    public List<ExpendTable> selectByExample(ExpendTable incomeTable) {
        ExpendTableExample example = new ExpendTableExample();

        ExpendTableExample.Criteria criteria=example.createCriteria();
        example.setOrderByClause("time desc");

        return expendTableMapper.selectByExample(example);
    }

    @Override
    public List<ExpendTable> queryByPage() {
        return expendTableMapper.queryByPage();
    }

    @Override
    public void insert(ExpendTable expendTable) {
        expendTableMapper.insert(expendTable);
    }
}